/**
 * API服务入口，根据环境切换真实API或模拟API
 */
import { menuApi, cartApi, orderApi, payApi, tableApi, userApi } from './api.js';
import { mockMenuApi, mockCartApi, mockOrderApi, mockPayApi, mockTableApi, mockUserApi } from './mock-api.js';

// 是否使用模拟API
const USE_MOCK_API = process.env.NODE_ENV === 'development';

// 导出API服务
export default {
  menuApi: USE_MOCK_API ? mockMenuApi : menuApi,
  cartApi: USE_MOCK_API ? mockCartApi : cartApi,
  orderApi: USE_MOCK_API ? mockOrderApi : orderApi,
  payApi: USE_MOCK_API ? mockPayApi : payApi,
  tableApi: USE_MOCK_API ? mockTableApi : tableApi,
  userApi: USE_MOCK_API ? mockUserApi : userApi
}; 